package com.linianda.算法;

public class 水仙花 {
    public static void main(String[] args){
        int a ;
        int b;
        int c;
        int n = 0;
        for (int m=101;m<1000;m++){
            a=m/100;
            b=m%100/10;
            c=m%10;
            if ((a*a*a + b*b*b + c*c*c)==m){
                n++;
                System.out.println(m+"是第"+n+"个水仙花函数");
            }
        }
    }
}
